﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.Web.Mvc;
using System.Web.Security;
using DealerJudge.App;
using DealerJudge.Entity;

namespace DealerJudge.Web.Models
{
    public class HomeModel
    {
        public List<Category> GetDealerCategory()
        {
            IDealerManager dealerMgr = DealerManagerFactory.GetDealerManager();
            return dealerMgr.GetCategory();
        }
        public List<Category> GetServiceCenterCategory()
        {
            return new List<Category> 
            {
                new Category
                {
                    Id = 1,
                    Name = "Cat1"
                },
                new Category
                {
                    Id =2,
                    Name = "Cat2"
                },
            };
        }
        public List<City> GetAllCities()
        {
            IDealerManager dealerMgr = DealerManagerFactory.GetDealerManager();
            return dealerMgr.GetAllCities();
        }

        public List<City> GetCityById(int id)
        {
            IDealerManager dealerMgr = DealerManagerFactory.GetDealerManager();
            return dealerMgr.GetCityById(id);
        }

        public List<City> GetCitiesByCategory(int cat_id)
        {
            IDealerManager dealerMgr = DealerManagerFactory.GetDealerManager();
            return dealerMgr.GetCitiesByCategory(cat_id);
        }

        public List<Manufacturer> GetManufacturerByCityAndCategory(int city_id, int cat_id)
        {
            IDealerManager dealerMgr = DealerManagerFactory.GetDealerManager();
            return dealerMgr.GetManufacturerByCityAndCategory(city_id, cat_id);
        }
        
        
    }
}